package com.pty.mercuryservice.service.impl;

import com.pty.mercuryservice.model.User;
import com.pty.mercuryservice.repository.UserRepository;
import com.pty.mercuryservice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Empty on 2017/6/27.
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User getUserByName(String username) {
        return userRepository.findByUsername(username);
    }

    @Override
    public void save(User user) {
        userRepository.save(user);
    }
}
